package com.ymatou.iapi.godmch.service;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*代理类型id批量查询返佣比例Call
*FreeMaker Template自动生成代码
*/
public class getRebateRateByIdListCall extends YmatouBaseCall{
	private static String opurl ="/api/agentType/getRebateRateByIdList";
	
	public getRebateRateByIdListCall() {
		super(EnvSetup.getSystemUrl("godmch_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	
	 public String getStatus1()
	 {
		 return getString("status");
	 }

	 public String getResult()
	 {
		 return getString("result");
	 }
	 
	 
	 
	 public JSONArray getRebateRateList() throws JSONException
		{
		 JSONArray infos=new JSONArray();
		  try{
			  //infos =  new Gson().fromJson(new JSONObject(getJsonObject().get("result").toString()).getJSONArray("rebateRateList"));
			 // infos =  new JSONObject(getJsonObject().get("result").toString()).getJSONArray("agentTypeRebateRateList");
			  infos =  new JSONObject(getString("result").toString()).getJSONArray("agentTypeRebateRateList");
			  
		} catch (Exception e) {
			
		}
		  return infos;
		}
}